#ifndef GRAMMARHANDLER_H
#define GRAMMARHANDLER_H
#include <string>
#include <map>
#include "handler.h"
using std::multimap;
using std::string;
using std::cout;
using std::endl;

class GrammarHandler:public Handler  {
public:
  GrammarHandler() :Handler(), grammar(), lastNonTerminal() {}
  ~GrammarHandler(){
	  grammar.clear();
	  cout<<"delete GrammarHandler"<<endl;
  }

  // The next functor will handle character data
  void operator()(const string&, const string&);

  // The next functor will handle start tags
  void operator()(const string&, const char *attr[]);

  const multimap<string , string>& getGrammar() const {
    return grammar;
  }

private:
  //map<string, string> xmlData; //changed xmlData to grammar
  multimap<string, string> grammar; //changed xmlData to grammar
  string lastNonTerminal;
};
#endif
